import copy


def use_list_copy():
    """
    使用列表自身的copy
    """
    a = [1, 2, 3]
    b = a.copy()
    b[0] = 10
    print(a)
    print(b)
def use_deepcopy():
    """
    递归去copy，不管有多少层，都会新做一个空间，把数据拿进来
    :return:
    """
    a = [1, 2]
    b = [3, 4]
    c = [a, b]
    d = copy.deepcopy(c)
    print(id(c))
    print(id(d))
    a[0] = 10
    print(f'c--{c}')
    print(f'd--{d}')
    print('-' * 50)
    print(id(c[0]), id(c[1]))
    print(id(d[0]), id(d[1]))

use_deepcopy()